/*   **********************************************************************  **
 **   Copyright notice                                                       **
 **                                                                          **
 **   (c) 2009, Around(J2)ME				                                 **
 **   All rights reserved.                                                   **
 **                                                                          **
 **   This program and the accompanying materials are made available under   **
 **   the terms of the New BSD License which accompanies this    			 **
 **   distribution.											                 **
 **   A copy is found in the textfile LICENSE.txt							 **
 **                                                                          **
 **   This copyright notice MUST APPEAR in all copies of the file!           **
 **                                                                          **
 **   Main developers:                                                       **
 **     Juri Strumpflohner		http://blog.js-development.com	             **
 **		Matthias Braunhofer		http://matthias.jimdo.com                    **
 **                                                                          **
 **  **********************************************************************  */

package org.aroundme.model;

import java.util.HashSet;
import java.util.Set;
/**
 * Business class representing a Location
 *  @author Juri Strumpflohner
 */
public class Location {
	private int id;
	private String cellid;
	private String lat;
	private String lon;
	private Set<Place> places = new HashSet<Place>();
	
	public Location(){
	}

	public String getCellid() {
		return cellid;
	}

	public void setCellid(String cellid) {
		this.cellid = cellid;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getLat() {
		return lat;
	}

	public void setLat(String lat) {
		this.lat = lat;
	}

	public String getLon() {
		return lon;
	}

	public void setLon(String lon) {
		this.lon = lon;
	}

	public Set getPlaces() {
		return places;
	}

	public void setPlaces(Set<Place> places) {
		this.places = places;
		
		//TODO check why this has been done before!!
		
//		for (Place p : places) {
//			p.setLocation(this);
//		}
	}
	
	/**
	 * Adds a new Place object to the current location
	 * @param p Object of type Place
	 */
	public void addPlace(Place p){
		this.places.add(p);
		p.setLocation(this);
	}

}
